iommu: Handle sibling device assignment correctly
authorKeir Fraser <keir.fraser@citrix.com>
Wed, 28 May 2008 13:41:23 +0000 (14:41 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Wed, 28 May 2008 13:41:23 +0000 (14:41 +0100)
commit491c0ade25702af5fc89d00667687091a52a66b2
tree863786eb46dadaff7db3c4b98ec5cd93efe7196a
parent32c028cd83f268e170a7afa73a9ddbc2bca12eb5
iommu: Handle sibling device assignment correctly

Domctl interface is extended to allow libxc retrieve device group
information from hypervisor. Vendor-specific iommu_ops is also
extended by adding a new operation "get_device_group_id()", which is
currently a null pointer but could be implemented later for vt-d.

Error will be raised from tools side when user trying to assign PCI
device with a sibling device being driven by dom0. User will keep
being prompted until he has hidden the entire device group (at least,
the sibling devices driven by dom0) in dom0 kernel
parameter. Hopefully this framework could be flexible enough to
support both amd iommu and vt-d.

The following 2 cases are not covered by this patch, but should be
easy to handle.
* Checking for hot-plug devices (maybe we can delay calling
ImageHandler.signalDeviceModel() until all checks are done?)
* Checking for splitted device group between different passthru
domains

Signed-off-by: Wei Wang <wei.wang2@amd.com>
tools/libxc/xc_domain.c
tools/libxc/xenctrl.h
tools/python/xen/lowlevel/xc/xc.c
tools/python/xen/xend/server/pciif.py
xen/arch/x86/domctl.c
xen/drivers/passthrough/amd/pci_amd_iommu.c
xen/drivers/passthrough/iommu.c
xen/drivers/passthrough/vtd/iommu.c
xen/include/public/domctl.h
xen/include/xen/iommu.h